package cn.itcast.hotel;

public class MyThreadDemo {
    public static void main(String[] args) {
 /*       MyThread myThread = new MyThread();
        myThread.start();
        MyThread myThread1 = new MyThread();
        myThread1.start();*/

        MyRun m1 = new MyRun();
        Thread t1 = new Thread(m1);
        MyRun m2 = new MyRun();
        Thread t2 = new Thread(m2);
        t1.start();
        t2.start();
    }
}
class MyRun implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 20; i++) {
            System.out.println(Thread.currentThread().getName()+"==="+i);
        }
    }
}
class MyThread extends Thread {
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            System.out.println(Thread.currentThread().getName() + "====" + i);
        }
    }
}